package vn.lumi.smarthome;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Locale;

import vn.lumi.smarthome.ui.ChangeFont;

import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class LumiHome extends Application {
	public static Socket socket = new Socket();
	public static String LAN_ip = "";
	public static int LAN_port = 0;
	public static String DNS_address = "";
	public static int WAN_port = 0;
	public static InputStream is;
	public static OutputStream os;
	public static int Uid = 0;
	public static int Session_id = 0;
	public static int HC_Config_ver = 0;

	public static int SOCKET_OPENED = 1;
	public static int SOCKET_RECONNECTING = 2;
	public static int SOCKET_CLOSED = 3;

	public static int SocketState = SOCKET_OPENED;
	public static boolean isOSClosed = false;
	public static boolean isISClosed = false;

	public static int Timeout = 0;
	// public static String user = "";
	public static String password = "";
	public static String font = "helveticaneuelight.ttf";
	public static String fontBold = "helveticaneue.ttf";
	public static final int sizeTittle = 19;
	public static final int sizeContent = 17;
	public static final int sizeButton = 18;

//	private static Toast mToast = null;
//
//	public static void showToast(Context mContext, String text) {
//		if (mToast != null) {
//			mToast.cancel();
//			mToast = null;
//		}
//		mToast = Toast.makeText(mContext, text, Toast.LENGTH_LONG);
//		mToast.show();
//	}
	
	
	// public static void showToast(Context mContext, String text) {
	// if (mToast != null) {
	// mToast.cancel();
	// mToast = null;
	// }
	// LayoutInflater inflater = (LayoutInflater) mContext
	// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	// // Call toast.xml file for toast layout
	// View toastRoot = inflater.inflate(R.layout.activity_toast, null);
	// TextView tv = (TextView) toastRoot.findViewById(R.id.activity_toast_tv);
	// ChangeFont changeFont = new ChangeFont(mContext);
	// tv = changeFont.changeFontTextView(tv, text, LumiHome.font,
	// LumiHome.sizeContent, Gravity.NO_GRAVITY, mContext
	// .getResources().getColor(R.color.greenActionbar));
	//
	// mToast = new Toast(mContext);
	//
	// // Set layout to toast
	// mToast.setView(toastRoot);
	// mToast.setDuration(Toast.LENGTH_LONG);
	// mToast.show();
	// }

}
